// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_BPT_DRAW_BLUEPRINT_CHANGES_ITEM
// * CreateDate    : 2012/3/24 10:25:13
// * Creater       : CodeSmith
// * LastChangeDate: 2012/3/24 10:25:13
// * LastChanger   : 2012/3/24 10:25:13
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Bpt
{
/// <summary>
    /// BptDrawBlueprintChangesItem
    /// </summary>
    public partial class BptDrawBlueprintChangesItemBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objBptDrawBlueprintChangesItemEntity">Entity</param>
        /// <returns>Entity</returns>
        public static BptDrawBlueprintChangesItemEntity GetBptDrawBlueprintChangesItem(BptDrawBlueprintChangesItemEntity objBptDrawBlueprintChangesItemEntity)
        {
            return DataAccess.SelectSingle<BptDrawBlueprintChangesItemEntity>(objBptDrawBlueprintChangesItemEntity);
        }
        public static DataTable GetBptDrawBlueprintChangesItemByID(string ChangesId)
        {
            string sql = "SELECT * FROM DBO.BPT_DRAW_BLUEPRINT_CHANGES_ITEM A ";
            sql += "left join dbo.BPT_BLUEPRINT B on A.BLUEPRINT_ID=B.BLUEPRINT_ID ";
            sql += "LEFT JOIN dbo.MST_PRODUCT C ON A.PRODUCT_ID=C.PRODUCT_ID ";
            sql += "where A.DRAW_CHANGES_ID='" + ChangesId + "'";
            DataSet ds = new DataSet();
            ds = DataAccess.SelectDataSet(sql);
            if (ds != null && ds.Tables.Count > 0)
            {
                return ds.Tables[0];
            }
            return null;
        }

        public static BptDrawBlueprintChangesItemEntity GetBptChangesItemByID(string changesItemId)
        {
            if (string.IsNullOrEmpty(changesItemId))
            {
                return null;
            }
            BptDrawBlueprintChangesItemEntity entity = new BptDrawBlueprintChangesItemEntity();
            entity.DrawChangesItemId = changesItemId;
            return DataAccess.SelectSingle<BptDrawBlueprintChangesItemEntity>(entity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objBptDrawBlueprintChangesItemEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertBptDrawBlueprintChangesItem(BptDrawBlueprintChangesItemEntity objBptDrawBlueprintChangesItemEntity)
        {
            return DataAccess.Insert(objBptDrawBlueprintChangesItemEntity);
        }

        public static bool InsertBptDrawBlueprintChangesItem(List<BptDrawBlueprintChangesItemEntity> objBptDrawBlueprintChangesItemEntityList)
        {
            return DataAccess.Insert(objBptDrawBlueprintChangesItemEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objBptDrawBlueprintChangesItemEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateBptDrawBlueprintChangesItem(BptDrawBlueprintChangesItemEntity objBptDrawBlueprintChangesItemEntity)
        {
            return DataAccess.Update(objBptDrawBlueprintChangesItemEntity);
        }

        public static bool UpdateBptDrawBlueprintChangesItem(List<BptDrawBlueprintChangesItemEntity> objBptDrawBlueprintChangesItemEntityList)
        {
            return DataAccess.Update<BptDrawBlueprintChangesItemEntity>(objBptDrawBlueprintChangesItemEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objBptDrawBlueprintChangesItemEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteBptDrawBlueprintChangesItem(BptDrawBlueprintChangesItemEntity objBptDrawBlueprintChangesItemEntity)
        {
            return DataAccess.Delete(objBptDrawBlueprintChangesItemEntity);
        }

        public static bool DeleteBptDrawBlueprintChangesItem(List<BptDrawBlueprintChangesItemEntity> objBptDrawBlueprintChangesItemEntityList)
        {
            return DataAccess.Delete<BptDrawBlueprintChangesItemEntity>(objBptDrawBlueprintChangesItemEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetBptDrawBlueprintChangesItemAll()
        {
            return DataAccess.SelectAllDataSet<BptDrawBlueprintChangesItemEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<BptDrawBlueprintChangesItemEntity> GetBptDrawBlueprintChangesItemAllList()
        {
            return DataAccess.SelectAll<BptDrawBlueprintChangesItemEntity>();
        }
        #endregion
	}
	
	
}	

